<template>
  <div class="head">
    标题：<el-input v-model="input" placeholder="请输入内容标题" />
    发布时间：<el-date-picker
      v-model="value"
      type="date"
      placeholder="请选择发布时间"
    />
  </div>
  <textarea id="mytextarea" placeholder="请输入要发布的内容"></textarea>
  <el-button type="primary" @click="handlesubmit">提交</el-button>
</template>

<script setup>
import { onMounted, ref } from "vue";

const value = ref();
const input = ref();

onMounted(() => {
  tinymce.init({
    selector: "#mytextarea",
    plugins: "advlist autolink link image lists charmap print preview", //插件
    paste_data_images: true,
    branding: false,
    height: 490,
  });
});

function handlesubmit() {
  console.log("标题：", input.value);
  console.log("发布时间：", value.value);
  console.log(tinymce.activeEditor.getContent());
}
</script>

<style lang="scss" scoped>
.head {
  width: 200px;
  height: 100px;
  margin-top: -10px;
  margin-bottom: 10px;
}
.el-button {
  margin: 16px 0;
  float: right;
}
</style>
